﻿using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.Article;

namespace Simple.Services.System.Article.Model
{
    public class ArticleCreateOrUpdateModel : ModelBase
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public Guid? Id { get; set; } = null;

        /// <summary>
        /// 文章标题
        /// </summary>
        public string? Title { get; set; } = "";

        /// <summary>
        /// 分类Id
        /// </summary>
        public Guid? CategoryId { get; set; }

        /// <summary>
        /// 文章是否是否显示
        /// </summary>
        public bool? IsShow { get; set; } = true;

        /// <summary>
        /// 显示区域 1-家长，2园务
        /// </summary>
        public string? ShowRange { get; set; } = "";

        /// <summary>
        /// 文章内容
        /// </summary>
        public string? ArticleContent { get; set; } = "";

        /// <summary>
        /// 图片集合
        /// </summary>
        public List<IFormFile>? ImageList { get; set; } = null;

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<ArticleManage, ArticleCreateOrUpdateModel>();

            profile.CreateMap<ArticleCreateOrUpdateModel, ArticleManage>();
        }
    }
}
